package cn.mazexal.exambg.dataware;

import cn.mazexal.exambg.models.db.ExamQuestionRelationshipDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * User: Mazexal
 * Date: 2025/6/3
 */
@Mapper
public interface ExamQuestionRelationshipMapper extends BaseMapper<ExamQuestionRelationshipDO> {
    @Select("select * from exam_question_relationship where exam_id = #{examId} and question_id = #{questionId} limit 1")
    ExamQuestionRelationshipDO getByBothId(Long examId, Long questionId);

    @Delete("delete from exam_question_relationship where  exam_id = #{examId} and question_id = #{questionId}")
    void deleteByQuestionId(@Param("questionId") Long questionId,@Param("examId") Long examId);
}
